package com.olympus.hermes.product.domain;

import com.olympus.hermes.common.support.AbstractEntity;
import com.olympus.hermes.product.constants.PublishState;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author Mickey
 * @since 2021/2/5
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "hermes_product")
public class Product extends AbstractEntity {

    @Column(columnDefinition = "varchar(64) DEFAULT NULL COMMENT '商品名称'")
    private String name;

    @Column(columnDefinition = "bigint(20) DEFAULT NULL COMMENT '分类id'")
    private Long categoryId;

    @Column(columnDefinition = "bigint(20) DEFAULT NULL COMMENT '品牌id'")
    private Long brandId;

    @Column(columnDefinition = "varchar(256) DEFAULT NULL COMMENT '商品描述'")
    private String description;

    @Column(columnDefinition = "int(10) DEFAULT NULL COMMENT '上架状态'")
    @Convert(converter = PublishState.Converter.class)
    private PublishState publishState;

    @Column(columnDefinition = "bigint(20) DEFAULT NULL COMMENT '商品重量'")
    private BigDecimal weight;

}
